package com.take.state;

import com.take.common.CustomException;

public interface OrderState {

    OrderStateEnum orderStateType();
    
    default void pay(OrderStateMachine stateMachine) throws CustomException {
        System.out.println("|--当前订单状态不支持支付，已忽略操作");
        throw new CustomException("当前订单状态不支持支付，已忽略操作");
    }
    default void cancel(OrderStateMachine stateMachine)throws CustomException  {
        System.out.println("|--当前订单状态不支持取消，已忽略操作");
        throw new CustomException("当前订单状态不支持取消，已忽略操作");
    }
    default void deliver(OrderStateMachine stateMachine)throws CustomException  {
        System.out.println("|--当前订单状态不支持发货，已忽略操作");
        throw new CustomException("当前订单状态不支持发货，已忽略操作");
    }
    default void receive(OrderStateMachine stateMachine)throws CustomException  {
        System.out.println("|--当前订单状态不支持收货，已忽略操作");
        throw new CustomException("当前订单状态不支持收货，已忽略操作");
    }
}
